Skip to content

Instantly share code, notes, and snippets.

git diff /root/.viminfo
diff --git a/root/.viminfo b/root/.viminfo
index 71bf900..797e089 100644
--- a/root/.viminfo
+++ b/root/.viminfo
@@ -8,8 +8,8 @@
# hlsearch on (H) or off (h):
~h
# Command Line History (newest to oldest):
-:wq
git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: proc/self
modified: proc/thread-self
modified: run/log/journal/195a303ea1c8760dc28e54315b1c54bb/system.journal
@jblac
jblac / _etc_init.d_.depend.boot
Created May 4, 2020 02:52
salt-storer - system wide git diff.
-TARGETS = console-setup mountkernfs.sh resolvconf ufw plymouth-log apparmor hostname.sh x11-common screen-cleanup lm-sensors udev cryptdisks cryptdisks-early open-iscsi networking iscsid checkroot.sh lvm2 checkfs.sh rpcbind urandom hwclock.sh mountdevsubfs.sh mountall.sh bootmisc.sh mountall-bootclean.sh checkroot-bootclean.sh kmod mountnfs.sh mountnfs-bootclean.sh procps
+TARGETS = console-setup mountkernfs.sh resolvconf ufw plymouth-log hostname.sh x11-common screen-cleanup lm-sensors udev cryptdisks cryptdisks-early open-iscsi networking iscsid checkroot.sh lvm2 checkfs.sh rpcbind urandom hwclock.sh mountdevsubfs.sh mountall.sh bootmisc.sh mountall-bootclean.sh checkroot-bootclean.sh kmod mountnfs.sh mountnfs-bootclean.sh procps
@jblac
jblac / git.status
Last active May 12, 2020 18:27
Salt-Master
git status
On branch master
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
deleted: etc/apparmor.d/cache/.features
deleted: etc/apparmor.d/cache/lxc-containers
deleted: etc/apparmor.d/cache/sbin.dhclient
@jblac
jblac / 0_reuse_code.js
Created May 31, 2017 15:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
class generateToken {
public function crypto_rand_secure($min, $max) {
$range = $max - $min;
if ($range < 0 ) { return $min; }
$log = log($range, 2);
$bytes = (int) ( $log / 8 ) + 1;
$bits = (int) $log + 1;
<?php
class XmlToJson {
public function Parse ($url) {
$fileContents= file_get_contents($url);
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
$simpleXml = simplexml_load_string($fileContents);
$json = json_encode($simpleXml);
return $json;
public function getAppointmentBlocksInRange($start, $end, $agent) {
$em = $this->em;
$rsm = new ResultSetMapping();
$rsm->addScalarResult('id', 'id');
$rsm->addScalarResult('startTime', 'startTime');
$rsm->addScalarResult('startTime1', 'startTime1');
$rsm->addScalarResult('endTime', 'endTime');
$rsm->addScalarResult('endTime1', 'endTime1');
$rsm->addScalarResult('caseManager', 'caseManager');
SELECT a.id as id, DATE(a.startTime) AS startTime, DATE(a.endTime) AS endTime, a.startTime AS startTime1,
a.endTime AS endTime1, CONCAT(p.`first_name`, ' ', p.last_name) as `caseManager` FROM appointmentBlock a
JOIN `User` p ON p.id = a.`caseManager_id` WHERE a.startTime BETWEEN :start AND :end
GROUP BY a.startTime, a.caseManager_id
Array
(
[0] => Array
(
[id] => 1
$form = $this->createForm(new dateSelectType(), array('id'=>$id));
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('id', 'hidden')
->add('startDate', 'text',
array(
'attr' => array('class' => 'date'),
'required' => false,