Skip to content

Instantly share code, notes, and snippets.

View fedir's full-sized avatar
🌤️
The sun is behind every cloud

Fedir RYKHTIK fedir

🌤️
The sun is behind every cloud
View GitHub Profile
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@nicolargo
nicolargo / tips.py
Last active May 5, 2020 08:37
Python tips for optimization
#############################################################################
# Apply a function to a list
#############################################################################
# Instead of...
newlist = []
for word in oldlist:
newlist.append(word.upper())
# ... use map
@capaj
capaj / app-config.js
Created May 27, 2015 09:07
useful config for your angular apps
app.config(function($compileProvider) {
if (!location.host.match(/localhost/)) {
$compileProvider.debugInfoEnabled(false);
}
})
@fedir
fedir / iptables.sh
Last active February 10, 2016 17:00
iptables modification with backup
# Backup
iptables-save > my-iptables
# Forbid access by an IP
iptables -A INPUT -p tcp --dport 8000 -s 1.2.3.4 -j ACCEPT
iptables -A INPUT -p tcp --dport 8000 -j DROP
# Optional restore OR manual modification apply
#iptables-restore < my-iptables
.platform-android4_1 {
/*Any styles for android 4.1*/
}
.platform-android4_3 {
/*Any styles for android 4.3*/
}
.platform-android4_4 {
/*Any styles for android 4.4*/
@fedir
fedir / phpmailer.php
Last active March 28, 2018 17:55
Test send mail with PHP in Shell
<?php
// ## Requirements
//
// curl -sS https://getcomposer.org/installer | php
// mv composer.phar /usr/local/bin/composer
// composer require phpmailer/phpmailer
require 'vendor/autoload.php';
@fedir
fedir / basicLinuxSecurity.sh
Created February 17, 2015 09:13
Basic Linux Security
apt-get install fail2ban
apt-get update
apt-get upgrade
passwd
@cedricziel
cedricziel / README.md
Last active October 27, 2021 08:12
TYPO3 Extension with 3rd part composer dependencies. composer.json is placed in Resources/Private - Updated

Motivation

As long as composer support in CMS is "not there yet", you need to get around somehow.

Say you want to use the (awesome) markdown library, you need a way to get it in.

How

  1. Use a container extension with a private namespace
@irnnr
irnnr / README.md
Last active October 2, 2015 02:14
TYPO3 Dynamic Return Type code completion
@francoishill
francoishill / loop_files_folders_recursively.go
Created August 1, 2014 16:52
Loop through files and folders recursively in golang
package main
import (
"fmt"
"os"
"path/filepath"
)
func main() ([]string, error) {
searchDir := "c:/path/to/dir"