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 | |
#Usage: ./icons.sh ../assets/media/icon_color_1024.png ../assets/icons | |
name=$(basename "$1" ".png") | |
dir=$(cd "$(dirname "$2")"; pwd)/$(basename "$2") | |
mkdir $dir/$name.iconset | |
sips -Z 16 --out $dir/$name.iconset/icon_16x16.png $1 | |
sips -Z 32 --out $dir/$name.iconset/icon_16x16@2x.png $1 | |
sips -Z 32 --out $dir/$name.iconset/icon_32x32.png $1 |
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
// ==UserScript== | |
// @name Userscript Name | |
// @namespace http://example.com/ | |
// @description Userscript Description | |
// @match http://example.com/* (or @include * to include all pages) | |
// @version 1.0 | |
// ==/UserScript== | |
// Emulate Greasemonkey's unsafeWindow in Chrome | |
window.unsafeWindow = window.unsafeWindow || (function() { |
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 setGoogleDNS() { | |
CHANNEL=`route get google.com | grep interface | sed -n -e 's/^.*interface: //p'` | |
NETWORK=`networksetup -listnetworkserviceorder | grep $CHANNEL | sed -n -e 's/^.*Port: //p' | sed -n -e 's/,.*//p'` | |
echo "Setting Google's DNS on channel '$CHANNEL' for network '$NETWORK'." | |
sudo networksetup -setdnsservers $NETWORK 8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844 | |
} | |
function setCloudflareDNS() { | |
CHANNEL=`route get google.com | grep interface | sed -n -e 's/^.*interface: //p'` | |
NETWORK=`networksetup -listnetworkserviceorder | grep $CHANNEL | sed -n -e 's/^.*Port: //p' | sed -n -e 's/,.*//p'` |
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
var mousewheelevt=(/Firefox/i.test(navigator.userAgent))? "DOMMouseScroll" : "mousewheel"; | |
if (document.attachEvent) | |
document.attachEvent("on"+mousewheelevt, function(e){scroller(e)}); | |
else if (document.addEventListener) | |
document.addEventListener(mousewheelevt, function(e){scroller(e)},false); | |
function scroller(evt) | |
{ | |
//Guess the delta. |
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
license: gpl-3.0 | |
height: 1030 | |
scrolling: yes |
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
import ffmpeg form 'fluent-ffmpeg'; | |
const filePath = '/Users/yoann/Desktop/video.avi'; | |
const route = (req, res) => { | |
res.writeHead(200, getHeaders({'Content-Type': 'video/mp4'})); | |
ffmpeg(filePath) | |
.format('mp4') | |
.addOptions([ | |
'-movflags frag_keyframe+faststart' | |
]) |
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
CREATE TABLE IF NOT EXISTS `ci_sessions` ( | |
session_id varchar(40) DEFAULT '0' NOT NULL, | |
ip_address varchar(45) DEFAULT '0' NOT NULL, | |
user_agent varchar(120) NOT NULL, | |
last_activity int(10) unsigned DEFAULT 0 NOT NULL, | |
user_data text NOT NULL, | |
PRIMARY KEY (session_id), | |
KEY `last_activity_idx` (`last_activity`) | |
); |
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
const newWindow = new BrowserWindow({ | |
webPreferences: { | |
devTools: !IS_PRODUCTION | |
} | |
}); |
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
const video = document.querySelector('video'); | |
video.addEventListener('error', () => { | |
switch (video.error.code) { | |
case video.error.MEDIA_ERR_DECODE: | |
case video.error.MEDIA_ERR_SRC_NOT_SUPPORTED: | |
// Video format not supported. | |
break; | |
case video.error.MEDIA_ERR_ABORTED: | |
case video.error.MEDIA_ERR_NETWORK: | |
default: |
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
import { sign } from 'electron-osx-sign'; | |
import { PARENT_PLIST_PATH, CHILD_PLIST_PATH, DEV_PROVISIONING_PROFILE } from './config'; | |
const signApp = (appPath, pkgPath) => { | |
const resourcesPath = path.join(appPath, './Contents/Resources/'); | |
const signOpts = { | |
app: appPath, | |
platform: 'mas', | |
binaries: [ /* Here goes the list of binaries you have in your app, like the widevine plugin. */ ], | |
entitlements: PARENT_PLIST_PATH, |
NewerOlder