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
/* | |
* File: main.cpp | |
* Author: emrahgunduz | |
* | |
* Created on March 12, 2013, 3:57 PM | |
*/ | |
#include <iostream> | |
using namespace std; |
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
function handleMessage(data) { | |
if( typeof data == 'string' ) { | |
var strUtf8 = unescape( encodeURIComponent( data ) ); | |
var ab = new Uint8Array( strUtf8.length ); | |
var le = strUtf8.length; | |
for ( var i = 0; i < le; i++ ) { | |
ab[i] = strUtf8.charCodeAt(i); | |
} | |
data = ab; |
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
function getElementByXpath(path) { | |
var result = document.evaluate(path, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
for (var i = result.snapshotLength - 1; i >= 0; i--){ | |
console.log(result.snapshotItem(i)); | |
} | |
} |
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
for f in *.m4a; do g=`basename $f .m4a`; ffmpeg -i $f $g.mp3 || echo FAILED; done |
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
sshfs -o reconnect -C -o workaround=all -o allow_other -p 56987 [email protected]:/root/backup/ /root/backup |
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
function generateRainbowColors(count, createDiv){ | |
function rainbow(numOfSteps, step) { | |
var r, g, b; | |
var h = step / numOfSteps; | |
var i = ~~(h * 6); | |
var f = h * 6 - i; | |
var q = 1 - f; | |
switch(i % 6){ | |
case 0: r = 1; g = f; b = 0; break; |
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
function generateRainbowColors(count, createDiv, frequency1, frequency2, frequency3, phase1, phase2, phase3, center, width) { | |
var colors = []; | |
if(!count) count = 50; | |
if(!createDiv) createDiv = false; | |
if(!center) center = 128; | |
if(!width) width = 127; | |
if(!frequency1) frequency1 = .3; | |
if(!frequency2) frequency2 = .3; |
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 UIKit | |
class ViewController: UIViewController { | |
func addTheBlurView(data :Data) { | |
let generalFrame = self.view.bounds; | |
let parentView = UIView(frame: generalFrame) | |
self.view.addSubview(parentView) |
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 UIKit | |
import PlaygroundSupport | |
let generalFrame = CGRect(x: 0, y: 0, width: 500, height: 500) | |
let containerView = UIView(frame: generalFrame) | |
containerView.backgroundColor = UIColor.black; | |
PlaygroundPage.current.liveView = containerView | |
let parentView = UIView(frame: generalFrame) |
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
// "self" in here is an UIView that contains some images inside. | |
{ | |
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; | |
UIVisualEffectView *blurredEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; | |
CGRect frame = self.frame; | |
frame.origin = CGPointMake (0, 0); | |
blurredEffectView.frame = frame; | |
[self addSubview:blurredEffectView]; |
OlderNewer