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
// cc counter.c -o counter && ./counter | |
#include <stdio.h> | |
int get_1(); | |
int get_2(); | |
int get_3(); | |
int get_4(); | |
int get_5(); | |
int get_6(); | |
int get_7(); |
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
#!/usr/bin/env bash | |
sudo timedatectl set-time $(date -I) 01:00 | |
sleep_amounts=(IGNORE 1 1 1 1 1 1 1 1 1 1 1 1 1 1 20) | |
while :; do | |
hr=$(date +%H) | |
echo $hr | |
sleep "${sleep_amounts[$hr]}h" |
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
def one(): | |
print(1) | |
two = lambda: print(2) | |
import dis | |
dis.dis(one) | |
2 0 LOAD_GLOBAL 0 (print) | |
3 LOAD_CONST 1 (1) | |
6 CALL_FUNCTION 1 (1 positional, 0 keyword pair) | |
9 POP_TOP |
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
try { | |
$dql = <<<EOF | |
SELECT u, emailCfg | |
FROM Entities\Financial\transaction tract | |
LEFT JOIN tract.user u | |
LEFT JOIN u.emailConfiguration emailCfg | |
WHERE tract.id IN (?1) | |
EOF; | |
$query = $em->createQuery($dql); |
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 | |
/** | |
* @Embeddable | |
*/ | |
class DoctrineContact implements Contact | |
{ | |
/** | |
* @Column(name="ContactName") | |
*/ |
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
{% if grains['os.family'] == 'Arch' %} | |
composer: | |
pkg.installed | |
{% else %} | |
get-composer: | |
cmd.run: | |
- name: 'CURL=`which curl`; $CURL -sS https://getcomposer.org/installer | php' | |
- unless: test -f /usr/local/bin/composer | |
- cwd: /root/ |
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 | |
#plays videos in framebuffer | |
mplayer -vo fbdev -really-quiet |