Skip to content

Instantly share code, notes, and snippets.

View spacepluk's full-sized avatar

Oscar Morante spacepluk

  • Berlin
  • 22:39 (UTC +01:00)
View GitHub Profile
var gulp = require('gulp');
var browserify = require('browserify');
var handleErrors = require('../util/handleErrors');
var source = require('vinyl-source-stream');
var packageJson = require('../../package.json');
var dependencies = Object.keys(packageJson && packageJson.dependencies || {});
gulp.task('libs', function () {
# Maintainer: Eric Engestrom <aur [at] engestrom [dot] ch>
# Contributor: Attila Bukor <r1pp3rj4ck [at] w4it [dot] eu>
pkgname=popcorntime-git
pkgver=r3463.416dbc2
pkgrel=1
pkgdesc="Stream movies from torrents. Skip the downloads. Launch, click, watch."
arch=('i686' 'x86_64')
url="http://popcorntime.io"
license=('GPL3')
--- a/qtdeclarative/src/qml/qml/v8/qv8engine.cpp 2014-10-25 17:36:02.410146635 +0300
+++ b/qtdeclarative/src/qml/qml/v8/qv8engine.cpp 2014-10-25 17:36:55.327536841 +0300
@@ -478,12 +478,6 @@
void QV8Engine::freezeObject(const QV4::ValueRef value)
{
- QV4::Scope scope(m_v4Engine);
- QV4::ScopedFunctionObject f(scope, m_freezeObject.value());
- QV4::ScopedCallData callData(scope, 1);
- callData->args[0] = value;
var fibonacci = (n) => (n > 1) ? fibonacci(n - 1) + fibonacci(n - 2) :
(n == 1) ? 1 :
(n == 0) ? 0 :
undefined
#!/bin/sh
maxbrightness=`cat /sys/class/backlight/intel_backlight/max_brightness`
brightness=/sys/class/backlight/intel_backlight/brightness
sudo tee $brightness <<< $maxbrightness
# Common patterns
snippet ':f "object method string"
'${1:${2:#thing}:${3:click}}': function(element) {
${VISUAL}$0
}${10:,}
endsnippet
snippet :f "Object Method"
${1:method_name}: function(${3:attribute}) {
${VISUAL}$0
(def JSON (s/either s/Str
s/Num
s/Bool
[(s/recursive #'JSON)]
{s/Keyword (s/recursive #'JSON)}))
function generateUUID(){
var d = new Date().getTime(),
pattern = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
return pattern.replace(/[xy]/g, function(c) {
var r = (d + Math.random()*16)%16 | 0
d = Math.floor(d/16)
return (c=='x' ? r : (r&0x3|0x8)).toString(16)
})
}
(defn- generate-uuid []
(let [pattern "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
time-api (or js/performance js/Date)
now (atom (.now time-api))]
(replace pattern #"[xy]" (fn [char]
(let [r (-> (rand)
(* 16)
(+ @now)
(rem 16)
(int))
(defprotocol ITest (test [x] [x y]))
(defrecord Fails []
ITest
(test
([x] (str x))
([x y] (str x y))))
(defrecord Works []
ITest