# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
bind C-a send-prefix
unbind C-b
set -g mouse on
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
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md | |
https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md |
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
<?php | |
function escapetext($text) { | |
return str_replace("\n", "<br>", htmlentities($text)); | |
} | |
function exec_command($cmd, $internal = false) { | |
try { | |
$shell_exec = shell_exec($cmd); | |
} catch (Exception $e) { |
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 Promise = require('bluebird'); | |
var promiseWhile = function(condition, action) { | |
var resolver = Promise.defer(); | |
var loop = function() { | |
if (!condition()) return resolver.resolve(); | |
return Promise.cast(action()) | |
.then(loop) | |
.catch(resolver.reject); |
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
public class MainActivity extends | |
private PopupWindow popWindow; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
} |
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 SystemConfiguration.CaptiveNetwork | |
func getSSID() -> String{ | |
var currentSSID = "" | |
let interfaces = CNCopySupportedInterfaces() | |
if interfaces != nil { | |
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 AVFoundation | |
class ViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate { | |
let session : AVCaptureSession = AVCaptureSession() | |
var previewLayer : AVCaptureVideoPreviewLayer! | |
var highlightView : UIView = UIView() | |
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 | |
extension UIColor { | |
convenience init(hex: Int) { | |
self.init(hex: hex, alpha: 1.0) | |
} | |
convenience init(hex: Int, alpha: CGFloat) { | |
self.init( | |
red: CGFloat((hex & 0xFF0000) >> 16 / 255.0), |
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
// Subject to SQL injection | |
Student.query( | |
"SELECT * FROM student INNER JOIN course ON course.studentId=student.id WHERE student.id=" + req.param('student_id'), | |
function(err, students) { | |
} | |
) | |
// uses prepared statements to protect against sql injection | |
// https://github.com/brianc/node-postgres/wiki/Prepared-Statements#parameterized-queries |
NewerOlder