This file contains 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
// Copyright (c) 2023 Cloudflare, Inc. | |
// Licensed under the Apache 2.0 license found in the LICENSE file or at: | |
// https://opensource.org/licenses/Apache-2.0 | |
class D1Database { | |
fetcher; | |
constructor(fetcher) { | |
this.fetcher = fetcher; | |
} | |
prepare(query) { | |
return new D1PreparedStatement(this, query); |
This file contains 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
package yourpackage | |
import ( | |
goflag "flag" | |
"fmt" | |
"os" | |
"strings" | |
"testing" | |
flag "github.com/spf13/pflag" |
This file contains 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
// | |
// IPInsetLabel.h | |
// Instapaper | |
// | |
// Created by Marco Arment on 7/23/11. | |
// Copyright 2011 Instapaper LLC, released to the public domain. | |
// | |
#import <UIKit/UIKit.h> |
This file contains 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
function anonymous(locals, jade) { | |
var jade_debug = [{ lineno: 1, filename: "themes/doublerebel/views/blog/index.jade" }]; | |
try { | |
var buf = []; | |
var jade_mixins = {}; | |
var locals_ = (locals || {}),undefined = locals_.undefined,css = locals_.css,js = locals_.js; | |
jade_debug.unshift({ lineno: 0, filename: "themes/doublerebel/views/layout.jade" }); | |
jade_debug.unshift({ lineno: 1, filename: "themes/doublerebel/views/blog/index.jade" }); | |
buf.push("<html lang=\"en\">"); | |
jade_debug.unshift({ lineno: undefined, filename: jade_debug[0].filename }); |
This file contains 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
sudo -u git -H "$@" |
This file contains 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
#!/bin/sh | |
cd /home/git/repositories/$1 | |
git config --bool core.bare false | |
git config --path core.worktree $2 | |
git config receive.denycurrentbranch ignore | |
echo '#!/bin/sh\ngit checkout -f\n' >> hooks/post-receive | |
chmod +x hooks/post-receive | |
cd - |
This file contains 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/env iced | |
# Complete jake tasks script for bash | |
# Save it somewhere and then add | |
# complete -C path/to/script -o default jake | |
# to your ~/.bashrc | |
# Bug-fix from Xavier Shay's version | |
# ported from Ruby/Rakefile version https://gist.github.com/cayblood/2499921 | |
# to Node/IcedCoffee/Jakefile by doublerebel | |
# https://gist.github.com/doublerebel/6603667 |
This file contains 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
cp app-unsigned.apk temp.apk | |
jarsigner -verbose -keystore ~/.android/debug.keystore -digestalg SHA1 -sigalg MD5withRSA -storepass android -keypass android temp.apk androiddebugkey | |
$ANDROID_SDK/tools/zipalign -v 4 temp.apk temp.apkz | |
mv temp.apkz $1 && rm temp.apk |
This file contains 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
pointInPoly = (point,poly) -> | |
segments = for pointA, index in poly | |
pointB = poly[(index + 1) % poly.length] | |
[pointA,pointB] | |
intesected = (segment for segment in segments when rayIntesectsSegment(point,segment)) | |
intesected.length % 2 != 0 | |
rayIntesectsSegment = (p,segment) -> | |
[p1,p2] = segment | |
[a,b] = if p1.y < p2.y |
This file contains 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
// this sets the background color of the master UIView (when there are no windows/tab groups on it) | |
Titanium.UI.setBackgroundColor('#000'); | |
// create tab group | |
var tabGroup = Titanium.UI.createTabGroup(); | |
// | |
// create base UI tab and root window | |
// | |
var win1 = Titanium.UI.createWindow({ | |
title:'Tab 1', |
NewerOlder