Skip to content

Instantly share code, notes, and snippets.

@fret2buzz
fret2buzz / slack2html.php
Created February 14, 2016 22:45 — forked from felagsw/slack2html.php
slack2html
#!/usr/bin/php
<?php
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
@fret2buzz
fret2buzz / delete-from-slack.php
Created February 14, 2016 22:44 — forked from kasperhartwich/delete-from-slack.php
Script to delete old files from Slack
#!/usr/bin/env php
<?php
date_default_timezone_set('GMT');
if (count($argv)<2) {
echo $argv[0] . ' <token> <until>' . PHP_EOL;
echo 'Example: ' . $argv[0] . ' abcd-12345678-123456789-12345 \'-3 months\'' . PHP_EOL;
exit;
}
// You will also need to create a gmail filter to add the 'send-to-slack' label
// to any emails you want sent to slack
function sendEmailsToSlack() {
var label = GmailApp.getUserLabelByName('send-to-slack');
var messages = [];
var threads = label.getThreads();
for (var i = 0; i < threads.length; i++) {
messages = messages.concat(threads[i].getMessages())
@fret2buzz
fret2buzz / SassMeister-input.scss
Created January 27, 2016 13:34
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
/*bad*/
.text {
font-size: 12px;
.open & {
display: block;
}
<?php
$workingPath = 'c:/cleanup';
$cssFiles = $workingPath . '/working-folder';
$pngFiles = $cssFiles . '/png';
$files = glob($cssFiles . '/*.css');
$url = array();
$urldata = array();
<?php
$workingPath = 'h:/css';
$cssFiles = $workingPath . '/clear';
$cssFixedFiles = $workingPath . '/fixed';
$files = glob($cssFiles . '/*');
foreach($files as $k => $v) {
$basename = basename($v);
var_dump($basename);
@fret2buzz
fret2buzz / SassMeister-input-HTML.html
Created March 1, 2015 16:39
Generated by SassMeister.com.
<div class="item item-1"></div>
<div class="item item-2"></div>
<div class="item item-3"></div>
<div class="item item-4"></div>
<div class="item item-5"></div>
<div class="item item-6"></div>
<div class="item item-7"></div>
<div class="item item-8"></div>
<div class="item item-9"></div>
<div class="item item-10"></div>
@fret2buzz
fret2buzz / gist:8378321
Created January 11, 2014 23:21
delete folder with all subfolders
rd /s/q "%allusersprofile%\start menu\programs\games"
the rd stands for remove directory
The /s switch is for all sub directories and files in the dir
The /q switch is for quiet mode, which means it wont ask you for confirmation
@fret2buzz
fret2buzz / gist:8371035
Created January 11, 2014 13:37
bootstrap 3 custom pager outside carousel container
//carousel-nav
$( "#carousel1-nav li" ).each(function( index ) {
$(this).attr('data-slide-to', index);
});
// $('#nofx').html('<ol></ol>');
// $( "#carousel1 .item" ).each(function( index ) {
// $('#nofx ol').append('<li data-slide-to="' + index + '">' + index + '</li>');
// });
@fret2buzz
fret2buzz / gist:8328443
Last active January 2, 2016 16:09
пароль
<!-- Джаваскрипт для блока авторизации -->
<script type="text/javascript">
function changeBox()
{
document.getElementById('div1').style.display='none';
document.getElementById('div2').style.display='';
document.getElementById('password').focus();
}
function restoreBox()
{