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
<?php | |
// https://wiki.apache.org/solr/UpdateJSON | |
$data = array( | |
array( | |
'id' => $id, | |
'field' => array( | |
'set' => 'value', // set is keyword | |
) | |
) | |
); |
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
server { | |
listen 80 | |
server_name example | |
location / { | |
root /var/www/your/app; | |
if (!-e $request_filename){ # handles page reload | |
rewrite ^(.*)$ /views/index.html break; | |
} | |
index /views/index.html; | |
} |
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
<?php | |
namespace Avdily; | |
use Nette; | |
class TemplateHelpers extends Nette\Object { | |
/** @var string */ | |
private $wwwDir; |
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/bash | |
# http://linuxaria.com/howto/using-opendkim-to-sign-postfix-mails-on-debian | |
# | |
# Note: | |
# opendkim-genkey has been changed (-h sha256) | |
redColor='\033[0;31m' | |
greenColor='\033[0;32m' | |
noColor='\033[0m' |
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 | |
# Init. script for phantomjs, based on Ubuntu 12.04 skeleton. | |
# Author: Anthony Lapenna <lapenna.anthony@gmail.com> | |
PATH=/sbin:/usr/sbin:/bin:/usr/bin | |
DESC="Phantomjs service" | |
NAME=phantomjs | |
DAEMON=/usr/bin/$NAME | |
PIDFILE=/var/run/$NAME.pid | |
SCRIPTNAME=/etc/init.d/$NAME |
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/bash | |
now=$(date +"%Y-%m-%d") | |
mysqlUser="root" | |
mysqlPass="xxx" | |
server="user@server.com" | |
log="./backup_sql.log" | |
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
<?php | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @ORM\Entity() | |
* @ORM\Table(name="user") | |
*/ | |
class User |
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/bash | |
youtube-dl --extract-audio --audio-format "mp3" --audio-quality 1 --batch-file "list.txt" |
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 mul(num1, num2) { | |
// Convert to array of string in reverse order (right to left calc) | |
num1 = `${num1}`.split('').reverse(); | |
num2 = `${num2}`.split('').reverse(); | |
// Init empty array | |
const d = []; | |
for(let i = 0; i < num1.length + num2.length; i++) { | |
d[i] = 0; |
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 branfuck(code, input){ | |
const output = []; | |
const data = []; | |
let dataPointer = 0; | |
let inputPointer = 0; | |
let inputArr = input.split('').map(i => i.codePointAt(0)) | |
const chars = code.split(''); | |
let codePointer = 0; | |
OlderNewer