- Don't run as root.
- For sessions, set
httpOnly
(andsecure
totrue
if running over SSL) when setting cookies. - Use the Helmet for secure headers: https://github.com/evilpacket/helmet
- Enable
csrf
for preventing Cross-Site Request Forgery: http://expressjs.com/api.html#csrf - Don't use the deprecated
bodyParser()
and only use multipart explicitly. To avoid multiparts vulnerability to 'temp file' bloat, use thedefer
property andpipe()
the multipart upload stream to the intended destination.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Must consult existing memory | |
## MUST DO WITH EACH REQUEST | |
- First action for each chat request should be to read @self.md and @project.md | |
- Last action for each chat should be to update @self.md and @project.md if needed. | |
## Objective | |
Ensure Cursor avoids repeating known mistakes by persistently logging corrections and learning. All requests must reference stored knowledge in: | |
- `.remember/memory/self.md` — for known mistakes and their fixes | |
- `.remember/memory/project.md` — for user preferences and custom rules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dspy | |
from dspy.teleprompt import BootstrapFewShot | |
class CoT(dspy.Module): | |
def __init__(self): | |
super().__init__() | |
self.prog = dspy.ChainOfThought("question -> answer") | |
def forward(self, question): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/node | |
// use puppeteer 0.12.0 | |
// since puppeteer has problems in socks5 | |
// use polipo as a http proxy, which parent proxy is tor (localhost:9050) | |
var time = require('time'); | |
var sleep = require('sleep'); | |
const random_max = 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
const firebase = require('firebase'); | |
if(!firebase.apps.length) { | |
let config = { | |
apiKey: "xxxxxxxxxxxxxxxxxxxxx", | |
authDomain: "xxxxxxxxxxxxxxxxxxxxxxxx", | |
databaseURL: "xxxxxxxxxxxxxxxxxxxxx", | |
projectId: "xxxxxxxxx", | |
storageBucket: "xxxxxxxxxxxxxxxxxxxx", |
###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require("request"), | |
cheerio = require("cheerio"), | |
url = "https://www.google.com/search?q=data+mining", | |
corpus = {}, | |
totalResults = 0, | |
resultsDownloaded = 0; | |
function callback () { | |
resultsDownloaded++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<br /><br /> | |
# React Native: Animated | |
ReactEurope 2015, Paris - Spencer Ahrens - Facebook | |
<br /><br /> | |
## Fluid Interactions | |
- People expect smooth, delightful experiences |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The examples provided by Facebook are for non-commercial testing and | |
* evaluation purposes only. | |
* | |
* Facebook reserves all rights not expressly granted. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL | |
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
NewerOlder